package com.mall.exception;

/**
 * 统一异常枚举类
 */
public enum MallExceptionEnum {

    NEED_USERNAME(10001,"用户名不能为空"),
    NEED_PASSWORD(10002,"密码不能为空"),
    NEED_PASSWORD_LENGTH(10003,"密码长度不能小于6"),
    NAME_EXISTS(10004,"名字已存在"),
    INSERT_FAILED(10005,"添加失败"),
    USER_ERROR_LOGIN(10006,"用户名或密码错误"),
    NEED_LOGIN(10007,"需要登录"),
    UPDATE_FAILED (10008,"更新失败"),
    NEED_ADMIN (10009,"需要管理员权限"),
    PARAM_ERROR(10010,"请求参数不合法"),
    NOT_EXIST_CATEGORY(10011,"该产品不存在"),
    DELETE_FAILED(10012,"删除失败"),
    NOT_EXIST_DIR(10013,"文件夹不存在"),
    NOT_EXIST_PRODUCT(10014,"不存在该商品"),
    NOT_SELL_STATUS(10015,"不在售卖状态"),
    NEED_STOCK(10016,"库存不足"),
    CART_IS_EMPTY(10017,"购物车没有选中的商品"),
    NOT_EXIST_ORDER(10018,"订单不存在"),
    NOT_YOUR_ORDER(10019,"这不是你的订单"),
    WRONG_ORDER_STATUS(10020,"订单状态异常"),
    SYSTEM_ERROR(20000,"系统异常");



    MallExceptionEnum(Integer status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    //异常状态码
    private Integer status;
    //异常状态信息
    private String msg;

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}